#ifndef GY_LINEWIDTHCOMBOBOX_H
#define GY_LINEWIDTHCOMBOBOX_H

#include <QComboBox>
#include <QListWidget>
#include <QListView>
#include "GY_PenWidget.h"

/** 自定义下拉框设置画笔线框
 * @brief The GY_LineWidthComboBox class
 */
class GY_CONTROLLIBRARY_EXPORT GY_LineWidthComboBox : public QComboBox
{
    Q_OBJECT
public:
    GY_LineWidthComboBox(QWidget* parent = nullptr);
    ~GY_LineWidthComboBox();

    void setType(int drawType); //设置样式
    int getCurrentIndex(); //获取当前显示项
    void setCurrentIndex(int index); //设置当前显示项
    void setList(QList<int> &list); //设置内容
    QList<int> getList(); //获取List内容
    void appendItem(const int& index);

private slots:
    void onClickPenWidget(const int& index);

signals:
    void selectedItemChanged(int currentIndex);

private:
    GY_PenWidget* m_pPenEdit;
//    QListView* m_pListView;
    QListWidget *m_pListWidget;
    QList<QColor> m_colorsList;
    int m_drawType;
    int m_index;
    QList<int> m_list;
};

#endif // GY_LINEWIDTHCOMBOBOX_H
